
#include "MenuH.h"
#include <windows.h>
#include <conio.h>
#include "rectangleH.h"
#include "ScreenH.h"
#include "Animation_H.h"
#include "Shape.h"
#include <typeinfo.h>
#include <iostream>
#include <fstream>

using namespace std;
class Application
{
	Menu generalMenu, shapeSelection, shapeAddMenu;
	int choiceG, choiceR, choiceS;
	enum eDisplayType {WITH_OVERLAP, WITHOUT_OVERLAP}; //Default Display Type for Drawing
	enum eAnimationType {WITHOUT_BORDERS, WITH_BORDERS};
	//RectangleSTLList RectangleL; // New list
	list<Rectangl *> L;  // ** should be converted to shape future - currently for testing
	list<Rectangl *> L2; // ** should be converted to shape future - currently for testing
	list<Shape *> listShape;
	list<Shape *> listShapeTemp;
	int sizeOfList;
	//Animation rectangleAnimation;
	
public:

	Application()
	{
		init();
	}
    
	~Application();

	void init();

	void applicationRun();
	
	void setDisplayType(eDisplayType type){displayType=type;};
	
	void setAnimationType(eAnimationType type){animationType=type;};

	bool isPointExistInList(int x, int y, Shape ** recOut);

	bool removeFromList(Shape * r);

	void AppGeneralFirstChoice();

	void AppGeneralSecondChoice();

	void AppGeneralThirdChoice();

	void AddGeneralFourthChoice();

	void AddGeneralFifthChoice();

	void AddGeneralSixChoice();

	void generalMenu_saveToFile();

	void generalMenu_loadFromFile();

	void Application::goMenuSelectShape(Shape * r, int x, int y);

	void AppRectangleSecondChoice(Shape * r);

	void AppRectangleThirdChoice(Shape * r);
	
	void AppRectangleFourthChoice(Shape * r);

	void AppRectangleFifthChoice(Shape * r);

	void goAndDrawPointFromUser(int x, int y, char c);

	void AppRectangleSixChoice(Shape * r);
	
	void AppRectangleSevenChoice(Shape *r);

	void AppShapeFirstChoice();

	void AppShapeSecondChoice();
	
	void copyShapeList(list<Shape*> & sourcelst, list<Shape*>& copylst);

	void freeShapeList(list<Shape*> &lst);

	void saveListToBinFile(const string filename );

	void saveListToTextFile(const string filename );

	void loadListFromBinFile(const string filename);

	void loadListFromTextFile(const string filename);

	void loadShapeFromFile(string shapeType, ifstream& file, boolean binary);

	void drawAllShapes();
private:

	eDisplayType displayType; 

	eAnimationType animationType;
};







